<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateCompanyInfo extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'logo' => 'required|max:191',
            'cname' => 'required|max:50',
            'hangye' => 'required|max:50',
            'renshu' => 'required|max:20',
            'xingzhi' => 'required|max:50',
            'jianjie' => 'required|max:2000',
            'province' => 'max:20',
            'city' => 'max:20',
            'area' => 'max:20',
            'detailed_address' => 'max:191',
            'video' => 'max:191',
            'music' => 'max:191',
            'phone' => 'max:20',
        ];
    }

    public function messages()
    {
        return [
            'logo.required' => '请上传公司LOGO',
            'logo.max' => 'LOGO错误',
            'cname.required' => '请输入公司名称',
            'cname.max' => '公司名称过长',
            'hangye.required' => '请输入行业名称',
            'hangye.max' => '行业名称过长',
            'renshu.required' => '请输入公司人数',
            'renshu.max' => '公司人数过长',
            'xingzhi.required' => '请输入公司性质',
            'xingzhi.max' => '公司性质过长',
            'jianjie.required' => '请输入公司简介',
            'jianjie.max' => '公司简介过长',
            'province.max' => '请正确选择公司地址',
            'city.max' => '请正确选择公司地址',
            'area.max' => '请正确选择公司地址',
            'detailed_address.max' => '详细地址过长',
            'video.max' => '视频错误',
            'music.max' => '音频错误',
            'phone.max' => '请正确输入联系电话',
        ];
    }
}
